﻿@namespace AntSK.Pages.Setting.AIModel
@using AntSK.Domain.Repositories
@using AntSK.Models
@using AntSK.Domain.Model.Enum
@page "/setting/model/add"
@page "/setting/model/add/{ModelId}"
@using AntSK.Services.Auth
@inherits AuthComponentBase


<PageContainer Title="新增模型">
    <ChildContent>
        <Card>
            <Form Model="@_aiModel"
                  Style="margin-top: 8px;"
                  OnFinish="HandleSubmit">
                <FormItem Label="模型描述" LabelCol="LayoutModel._formItemLayout.LabelCol" WrapperCol="LayoutModel._formItemLayout.WrapperCol">
                    <Input Placeholder="请输入模型描述" @bind-Value="@context.ModelDescription" />
                </FormItem>
                <FormItem Label="模型类型" LabelCol="LayoutModel._formItemLayout.LabelCol" WrapperCol="LayoutModel._formItemLayout.WrapperCol">
                    <RadioGroup @bind-Value="context.AIModelType">
                        <Radio RadioButton Value="@(AIModelType.Chat)">会话模型</Radio>
                         <Radio RadioButton Value="@(AIModelType.Embedding)">向量模型</Radio>
                     </RadioGroup>
                </FormItem>

                 <FormItem Label="模型地址" LabelCol="LayoutModel._formItemLayout.LabelCol" WrapperCol="LayoutModel._formItemLayout.WrapperCol">
                     <Input Placeholder="请输入模型地址" @bind-Value="@context.EndPoint" />
                 </FormItem>
                 <FormItem Label="模型名称" LabelCol="LayoutModel._formItemLayout.LabelCol" WrapperCol="LayoutModel._formItemLayout.WrapperCol">
                     <Input Placeholder="请输入模型名称" @bind-Value="@context.ModelName" />
                 </FormItem>
                <FormItem Label="模型秘钥" LabelCol="LayoutModel._formItemLayout.LabelCol" WrapperCol="LayoutModel._formItemLayout.WrapperCol">
                     <InputPassword @bind-Value="@context.ModelKey" Placeholder="请输入模型秘钥" Size="@InputSize.Large"  />
                </FormItem>
         
                <FormItem Label=" " Style="margin-top:32px" WrapperCol="LayoutModel._submitFormLayout.WrapperCol">
                    <Button Type="primary" OnClick="HandleSubmit">
                        保存
                    </Button>
                    <Button OnClick="Back">
                        返回
                    </Button>
                </FormItem>
            </Form>
        </Card>
    </ChildContent>
</PageContainer>

@code {

}
